/**
 * 
 */
package com.dalonedrow.module.hq.systems;

import com.dalonedrow.engine.systems.base.Diceroller;
import com.dalonedrow.globalvariables.constants.hq.GlobalConstants;

/**
 * @author Donald
 */
public final class HQDice {
	/** the one and only instance of the <code>HQDice</code> class. */
	private static HQDice	instance;
	/**
	 * Gives access to the singleton instance of {@link HQDice}.
	 * @return {@link HQDice}
	 */
	public static HQDice getInstance() {
		if (HQDice.instance == null) {
			HQDice.instance = new HQDice();
		}
		return HQDice.instance;
	}
	/**
	 * Rolls the HeroQuest dice.
	 * @return <code>int</code>
	 */
	public int rollHQDice() {
		final int three = 3, six = 6;
		int roll = GlobalConstants.DICE_SKULL;
		switch (Diceroller.getInstance().rolldX(six)) {
		case 1:
			roll = GlobalConstants.DICE_BLACK_SHIELD;
			break;
		case 2:
		case three:
			roll = GlobalConstants.DICE_WHITE_SHIELD;
			break;
		default:
			break;
		}
		return roll;
	}
}
